/**
 * 迭代器对象，例如
 * Array
 * Arguments
 * Set
 * Map
 * String
 * NodeList
 * 能使用for...in和for...of方法
 * 内置有Symbol.Iterator属性
 */

const xiyou = ["唐僧", "孙悟空", "猪八戒", "沙和尚"];
// for (let v of xiyou) {
//   console.log(v);
// }

const iterator = xiyou[Symbol.iterator]();
console.log(iterator.next());
console.log(iterator.next());
console.log(iterator.next());
console.log(iterator.next());
console.log(iterator.next());
console.log(iterator.next());
